﻿using UnityEngine;
using System.Collections;

public class ScrollBG : MonoBehaviour {

	public Vector2 speed = new Vector2(1f,1f);
	
	private Vector2 uv_off = Vector2.zero;

	
	// Update is called once per frame
	void Update () {
	
		uv_off = new Vector2(Camera.main.transform.position.x * speed.x,
		                     Camera.main.transform.position.y * speed.y)/10f;
		
		
		renderer.material.SetTextureOffset("_MainTex",uv_off);
	
	}
}
